<?php
include("db_connect.php");
include("class/objName.php");
$obj = new objName();
$on = true;
$cid = $_SESSION['id'];

$sql = "SELECT * FROM tblswaping where addoff='$cid' order by timepost";

$result = mysql_query($sql);
$i = mysql_num_rows($result);

if($i<=0){
echo '<div "><h3 style="color:white;">No Item Found</h3></div>';
}
else{

	echo "<form id='myformRequest'>";
	echo "<table class='itemRequest'  border='0' >
	<thead>
	<tr>
		
		<th id='tbl_head_color' style='width:1px; background-color:#ba3e3f; '>Status</th>
		<th id='tbl_head_color' style='width:1px; background-color:#ba3e3f; '>Title</th>
		<th id='tbl_head_color' style='width:200; background-color:#ba3e3f; '>Model</th>
		<th id='tbl_head_color' style='width:700px; background-color:#ba3e3f; '>Description</th>
		</tr>
	</thead>";


	while($row= mysql_fetch_array($result)){
		 echo "<tbody id='itemRequestchange'>";
			$o = $obj->displayimg($row['filename'],true);
		    $n = $obj->get_profile_name($row['addoff']);
			
			if($row['display'] == 1){
				$status="Displaying"; echo "<tr class='even'>";
			}
			else{
				$status="Not Displaying"; echo "<tr class='odd' style='background-color:#C8C8BD'>";
			}
		
			echo "<td valign='top'>" . $status . "</td>";
			echo "<td valign='top' width='100px'><img id='' width='215' height='130' src='images/vehicles/$o'><div>Posted by:<a href='#' style='color:red;' > $n </a>";
			echo	"<p>ItemName:".$row['name']."</br> Time posted:".$row['timepost']."</br><a href='preview.php?from=admin.&pageid=".$row['id']."' style='color:red'>Preview</a></p>";
			echo "</div></td>";
			echo"<td valign='top' width='100px'><div width='100'>Brand:" .$row['brand'] ."</br>Model: ".$row['model'] ."</br>Trans: ".$row['transmission']."</div></td>";
			echo"<td valign='top'><p align='justify'>" .$row['description']."</p></td>";
			 
		
		  echo "</tr>";
	}
	echo "</tbody></table></form>";


}	

?>